<template>
  <div id="main" :data="aa"></div>
</template>


<script setup>
import { onMounted } from "@vue/runtime-core";
import * as echarts from "echarts";

const lianxi = () => {
  var chartDom = document.getElementById("main");
  var myChart = echarts.init(chartDom);
  var option;

  const aa = () => {
    option = {
      xAxis: {
        type: "category",
        data: ["1", "2", "3", "4", "5", "6", "7"],
      },
      yAxis: {
        type: "value",
      },
      series: [
        {
          data: [150, 230, 224, 218, 135, 147, 260],
          type: "line",
        },
      ],
    };
  };

  option && myChart.setOption(option);
};
onMounted(lianxi);
</script>

<style scoped>
#main {
  width: 500px;
  height: 300px;
}
</style>